<template>
  <FullScreen />
  <el-divider />
  <DropDown />
  <el-divider />
  <div>
    <!-- 组件的key根据refreshKey的值动态变化 -->
    <DataList :key="refreshKey" />
    <!-- 点击按钮时，更新refreshKey的值，从而刷新组件 -->
    <el-button type="primary" @click="refreshComponent">
      <el-icon>
        <Refresh />
      </el-icon>
    </el-button>
  </div>
</template>
<script setup>
import DropDown from '@/components/widget/DropDown.vue'
import FullScreen from '@/components/widget/FullScreen.vue'
import { Refresh } from '@element-plus/icons-vue'
import { ref } from 'vue'
import DataList from '@/components/datalist/DataList.vue' // 假设这是你要刷新的组件

const refreshKey = ref(0)
const refreshComponent = () => {
  // 更新refreshKey的值，从而触发组件重新渲染
  refreshKey.value += 1
}
</script>
